- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/svn-release/Smi-0.93.1/Smi/src/SmiCoreCombineRule.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 //
    00004 // SmiCoreCombineRule.hpp: interface for the SmiCoreCombineRule classes.
    00005 //
    00006 //
    00007 // Alan King
    00008 // 9 March 2004
    00010
    00011 #if !defined(SmiCoreCombineRule_HPP)
    00012 #define SmiCoreCombineRule_HPP
    00013
    00014 #include "CoinPragma.hpp"
    00015 #include "CoinPackedVector.hpp"
    00016
    00036 class SmiCoreCombineRule
    00037 {
    00038 public:
    00041
    00042         virtual void Process(double *d1, int o1, const CoinPackedVector &cpv2, char *type=0)=0;
    00043         virtual void Process(double *d1, int o1, const int len, const int* inds, const double *dels, char *type=0)=0;
    00044         virtual CoinPackedVector * Process(CoinPackedVector *cpv1, CoinPackedVector *cpv2, char *type=0)=0;
    00045         virtual int Process(double *dr,const int dr_len,CoinPackedVector *cpv,double *dels,int *indx)=0;
    00046         virtual int Process(double *dr,const int dr_len,const int cpv_nels,const int* cpv_ind,const double *cpv_els,double *dels,int *indx)=0;
    00047         virtual ~SmiCoreCombineRule(){}
    00048 };
    00049
    00051 // SmiCoreCombineReplace
    00052 // -- concrete "replace" rule -- singleton pattern
    00054 class SmiCoreCombineReplace : public SmiCoreCombineRule
    00055 {
    00056 public:
    00057         static SmiCoreCombineReplace * Instance();
    00058         static void ClearInstance();
    00059         //Replace values in d1 with values from cpv2, where o1 is the offset to apply to d1
    00060         virtual void Process(double *d1, int o1, const CoinPackedVector &cpv2, char *type=0);
    00061         virtual void Process(double *d1, int o1, const int len, const int* inds, const double *dels, char *type=0);
    00062         virtual CoinPackedVector * Process(CoinPackedVector *cpv1, CoinPackedVector *cpv2, char *type=0);
    00063         virtual int Process(double *dr,const int dr_len,CoinPackedVector *cpv,double *dels,int *indx);
    00064         virtual int Process(double *dr,const int dr_len,const int nels, const int* cpv_ind,const double *cpv_els,double *dels,int *indx);
    00065 protected:
    00066         SmiCoreCombineReplace(){}
    00067 private:
    00068         static SmiCoreCombineReplace * _instance;
    00069 };
    00070
    00072 // SmiCoreCombineAdd
    00073 // -- concrete "add" rule -- singleton pattern
    00075 class SmiCoreCombineAdd : public SmiCoreCombineRule
    00076 {
    00077 public:
    00078         static SmiCoreCombineAdd * Instance();
    00079         static void ClearInstance();
    00080         virtual void Process(double *d1, int o1, const CoinPackedVector &cpv2, char* type=0);
    00081         virtual void Process(double *d1, int o1, const int len, const int* inds, const double *dels, char *type=0);
    00082         virtual CoinPackedVector * Process(CoinPackedVector *cpv1, CoinPackedVector *cpv2, char* type=0);
    00083         virtual int Process(double *dr,const int dr_len,CoinPackedVector *cpv,double *dels,int *indx);
    00084         virtual int Process(double *dr,const int dr_len,const int nels, const int* cpv_ind,const double *cpv_els,double *dels,int *indx);
    00085 protected:
    00086         SmiCoreCombineAdd(){}
    00087 private:
    00088         static SmiCoreCombineAdd * _instance;
    00089 };
    00090
    00091
    00092 #endif // !defined(SmiCoreCombineRule_HPP)