Ignore:
Timestamp:
Jan 29, 2010 9:25:07 AM (10 years ago)
Author:
forrest
Message:

moving sandbox stuff to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpCholeskyDense.hpp

    r1402 r1502  
    11/* $Id$ */
    2 /* Copyright (C) 2003, International Business Machines Corporation 
     2/* Copyright (C) 2003, International Business Machines Corporation
    33   and others.  All Rights Reserved. */
    44#ifndef ClpCholeskyDense_H
     
    99
    1010class ClpCholeskyDense : public ClpCholeskyBase {
    11  
     11
    1212public:
    13    /**@name Virtual methods that the derived classes provides  */
    14    /**@{*/
    15   /** Orders rows and saves pointer to matrix.and model.
    16    Returns non-zero if not enough memory */
    17   virtual int order(ClpInterior * model) ;
    18   /** Does Symbolic factorization given permutation.
    19       This is called immediately after order.  If user provides this then
    20       user must provide factorize and solve.  Otherwise the default factorization is used
    21       returns non-zero if not enough memory */
    22   virtual int symbolic();
    23   /** Factorize - filling in rowsDropped and returning number dropped.
    24       If return code negative then out of memory */
    25   virtual int factorize(const CoinWorkDouble * diagonal, int * rowsDropped) ;
    26   /** Uses factorization to solve. */
    27   virtual void solve (CoinWorkDouble * region) ;
    28   /**@}*/
     13    /**@name Virtual methods that the derived classes provides  */
     14    /**@{*/
     15    /** Orders rows and saves pointer to matrix.and model.
     16     Returns non-zero if not enough memory */
     17    virtual int order(ClpInterior * model) ;
     18    /** Does Symbolic factorization given permutation.
     19        This is called immediately after order.  If user provides this then
     20        user must provide factorize and solve.  Otherwise the default factorization is used
     21        returns non-zero if not enough memory */
     22    virtual int symbolic();
     23    /** Factorize - filling in rowsDropped and returning number dropped.
     24        If return code negative then out of memory */
     25    virtual int factorize(const CoinWorkDouble * diagonal, int * rowsDropped) ;
     26    /** Uses factorization to solve. */
     27    virtual void solve (CoinWorkDouble * region) ;
     28    /**@}*/
    2929
    30   /**@name Non virtual methods for ClpCholeskyDense  */
    31   /**@{*/
    32   /** Reserves space.
    33       If factor not NULL then just uses passed space
    34    Returns non-zero if not enough memory */
    35    int reserveSpace(const ClpCholeskyBase * factor, int numberRows) ;
    36   /** Returns space needed */
    37    CoinBigIndex space( int numberRows) const;
    38   /** part 2 of Factorize - filling in rowsDropped */
    39   void factorizePart2(int * rowsDropped) ;
    40   /** part 2 of Factorize - filling in rowsDropped - blocked */
    41   void factorizePart3(int * rowsDropped) ;
    42   /** Forward part of solve */
    43   void solveF1(longDouble * a,int n,CoinWorkDouble * region);
    44   void solveF2(longDouble * a,int n,CoinWorkDouble * region,CoinWorkDouble * region2);
    45   /** Backward part of solve */
    46   void solveB1(longDouble * a,int n,CoinWorkDouble * region);
    47   void solveB2(longDouble * a,int n,CoinWorkDouble * region,CoinWorkDouble * region2);
    48   int bNumber(const longDouble * array,int &, int&);
    49   /** A */
    50   inline longDouble * aMatrix() const
    51   { return sparseFactor_;}
    52   /** Diagonal */
    53   inline longDouble * diagonal() const
    54   { return diagonal_;}
    55   /**@}*/
     30    /**@name Non virtual methods for ClpCholeskyDense  */
     31    /**@{*/
     32    /** Reserves space.
     33        If factor not NULL then just uses passed space
     34     Returns non-zero if not enough memory */
     35    int reserveSpace(const ClpCholeskyBase * factor, int numberRows) ;
     36    /** Returns space needed */
     37    CoinBigIndex space( int numberRows) const;
     38    /** part 2 of Factorize - filling in rowsDropped */
     39    void factorizePart2(int * rowsDropped) ;
     40    /** part 2 of Factorize - filling in rowsDropped - blocked */
     41    void factorizePart3(int * rowsDropped) ;
     42    /** Forward part of solve */
     43    void solveF1(longDouble * a, int n, CoinWorkDouble * region);
     44    void solveF2(longDouble * a, int n, CoinWorkDouble * region, CoinWorkDouble * region2);
     45    /** Backward part of solve */
     46    void solveB1(longDouble * a, int n, CoinWorkDouble * region);
     47    void solveB2(longDouble * a, int n, CoinWorkDouble * region, CoinWorkDouble * region2);
     48    int bNumber(const longDouble * array, int &, int&);
     49    /** A */
     50    inline longDouble * aMatrix() const {
     51        return sparseFactor_;
     52    }
     53    /** Diagonal */
     54    inline longDouble * diagonal() const {
     55        return diagonal_;
     56    }
     57    /**@}*/
    5658
    5759
    58   /**@name Constructors, destructor */
    59   /**@{*/
    60   /** Default constructor. */
    61   ClpCholeskyDense();
    62   /** Destructor  */
    63   virtual ~ClpCholeskyDense();
    64   /** Copy */
    65   ClpCholeskyDense(const ClpCholeskyDense&);
    66   /** Assignment */
    67   ClpCholeskyDense& operator=(const ClpCholeskyDense&);
    68   /** Clone */
    69   virtual ClpCholeskyBase * clone() const ;
    70   /**@}*/
    71    
    72    
     60    /**@name Constructors, destructor */
     61    /**@{*/
     62    /** Default constructor. */
     63    ClpCholeskyDense();
     64    /** Destructor  */
     65    virtual ~ClpCholeskyDense();
     66    /** Copy */
     67    ClpCholeskyDense(const ClpCholeskyDense&);
     68    /** Assignment */
     69    ClpCholeskyDense& operator=(const ClpCholeskyDense&);
     70    /** Clone */
     71    virtual ClpCholeskyBase * clone() const ;
     72    /**@}*/
     73
     74
    7375private:
    74   /**@name Data members */
    75   /**@{*/
    76      /** Just borrowing space */
    77   bool borrowSpace_;
    78   /**@}*/
     76    /**@name Data members */
     77    /**@{*/
     78    /** Just borrowing space */
     79    bool borrowSpace_;
     80    /**@}*/
    7981};
    8082
    8183/* structure for C */
    82 typedef struct{
    83   longDouble * diagonal_;
    84   longDouble * a;
    85   longDouble * work;
    86   int * rowsDropped;
    87   double doubleParameters_[1]; /* corresponds to 10 */
    88   int integerParameters_[2]; /* corresponds to 34, nThreads */
    89   int n;
    90   int numberBlocks;
     84typedef struct {
     85    longDouble * diagonal_;
     86    longDouble * a;
     87    longDouble * work;
     88    int * rowsDropped;
     89    double doubleParameters_[1]; /* corresponds to 10 */
     90    int integerParameters_[2]; /* corresponds to 34, nThreads */
     91    int n;
     92    int numberBlocks;
    9193} ClpCholeskyDenseC;
    9294
    9395extern "C" {
    94   void ClpCholeskySpawn(void *);
     96    void ClpCholeskySpawn(void *);
    9597}
    96   /**Non leaf recursive factor */
    97   void
    98   ClpCholeskyCfactor(ClpCholeskyDenseC * thisStruct,
    99                      longDouble * a, int n, int numberBlocks,
    100                      longDouble * diagonal, longDouble * work, int * rowsDropped);
    101  
    102   /**Non leaf recursive triangle rectangle update */
    103   void
    104   ClpCholeskyCtriRec(ClpCholeskyDenseC * thisStruct,
    105                      longDouble * aTri, int nThis,
    106                      longDouble * aUnder, longDouble * diagonal,
    107                      longDouble * work,
    108                      int nLeft, int iBlock, int jBlock,
    109                      int numberBlocks);
    110   /**Non leaf recursive rectangle triangle update */
    111   void
    112   ClpCholeskyCrecTri(ClpCholeskyDenseC * thisStruct,
    113                      longDouble * aUnder, int nTri, int nDo,
    114                      int iBlock, int jBlock,longDouble * aTri,
    115                      longDouble * diagonal, longDouble * work,
    116                      int numberBlocks);
    117   /** Non leaf recursive rectangle rectangle update,
    118       nUnder is number of rows in iBlock,
    119       nUnderK is number of rows in kBlock
    120   */
    121   void
    122   ClpCholeskyCrecRec(ClpCholeskyDenseC * thisStruct,
    123                      longDouble * above, int nUnder, int nUnderK,
    124                      int nDo, longDouble * aUnder, longDouble *aOther,
    125                      longDouble * work,
    126                      int iBlock, int jBlock,
    127                      int numberBlocks);
    128   /**Leaf recursive factor */
    129   void
    130   ClpCholeskyCfactorLeaf(ClpCholeskyDenseC * thisStruct,
    131                          longDouble * a, int n,
    132                          longDouble * diagonal, longDouble * work,
    133                         int * rowsDropped);
    134   /**Leaf recursive triangle rectangle update */
    135   void
    136   ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/
    137                         longDouble * aTri, longDouble * aUnder,
    138                         longDouble * diagonal, longDouble * work,
    139                         int nUnder);
    140   /**Leaf recursive rectangle triangle update */
    141   void
    142   ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */
    143                          longDouble * aUnder, longDouble * aTri,
    144                         /*longDouble * diagonal,*/ longDouble * work, int nUnder);
    145   /** Leaf recursive rectangle rectangle update,
    146       nUnder is number of rows in iBlock,
    147       nUnderK is number of rows in kBlock
    148   */
    149   void
    150   ClpCholeskyCrecRecLeaf(/*ClpCholeskyDenseC * thisStruct, */
    151                          const longDouble * COIN_RESTRICT above,
    152                          const longDouble * COIN_RESTRICT aUnder,
    153                          longDouble * COIN_RESTRICT aOther,
    154                         const longDouble * COIN_RESTRICT work,
    155                         int nUnder);
     98/**Non leaf recursive factor */
     99void
     100ClpCholeskyCfactor(ClpCholeskyDenseC * thisStruct,
     101                   longDouble * a, int n, int numberBlocks,
     102                   longDouble * diagonal, longDouble * work, int * rowsDropped);
     103
     104/**Non leaf recursive triangle rectangle update */
     105void
     106ClpCholeskyCtriRec(ClpCholeskyDenseC * thisStruct,
     107                   longDouble * aTri, int nThis,
     108                   longDouble * aUnder, longDouble * diagonal,
     109                   longDouble * work,
     110                   int nLeft, int iBlock, int jBlock,
     111                   int numberBlocks);
     112/**Non leaf recursive rectangle triangle update */
     113void
     114ClpCholeskyCrecTri(ClpCholeskyDenseC * thisStruct,
     115                   longDouble * aUnder, int nTri, int nDo,
     116                   int iBlock, int jBlock, longDouble * aTri,
     117                   longDouble * diagonal, longDouble * work,
     118                   int numberBlocks);
     119/** Non leaf recursive rectangle rectangle update,
     120    nUnder is number of rows in iBlock,
     121    nUnderK is number of rows in kBlock
     122*/
     123void
     124ClpCholeskyCrecRec(ClpCholeskyDenseC * thisStruct,
     125                   longDouble * above, int nUnder, int nUnderK,
     126                   int nDo, longDouble * aUnder, longDouble *aOther,
     127                   longDouble * work,
     128                   int iBlock, int jBlock,
     129                   int numberBlocks);
     130/**Leaf recursive factor */
     131void
     132ClpCholeskyCfactorLeaf(ClpCholeskyDenseC * thisStruct,
     133                       longDouble * a, int n,
     134                       longDouble * diagonal, longDouble * work,
     135                      int * rowsDropped);
     136/**Leaf recursive triangle rectangle update */
     137void
     138ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/
     139    longDouble * aTri, longDouble * aUnder,
     140    longDouble * diagonal, longDouble * work,
     141    int nUnder);
     142/**Leaf recursive rectangle triangle update */
     143void
     144ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */
     145    longDouble * aUnder, longDouble * aTri,
     146    /*longDouble * diagonal,*/ longDouble * work, int nUnder);
     147/** Leaf recursive rectangle rectangle update,
     148    nUnder is number of rows in iBlock,
     149    nUnderK is number of rows in kBlock
     150*/
     151void
     152ClpCholeskyCrecRecLeaf(/*ClpCholeskyDenseC * thisStruct, */
     153    const longDouble * COIN_RESTRICT above,
     154    const longDouble * COIN_RESTRICT aUnder,
     155    longDouble * COIN_RESTRICT aOther,
     156    const longDouble * COIN_RESTRICT work,
     157    int nUnder);
    156158#endif
Note: See TracChangeset for help on using the changeset viewer.