/[escript]/trunk/escript/src/DataConstant.cpp
ViewVC logotype

Diff of /trunk/escript/src/DataConstant.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2741 by jfenwick, Thu Sep 17 06:01:30 2009 UTC revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC
# Line 27  Line 27 
27  #endif  #endif
28    
29  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
30    #include <boost/scoped_ptr.hpp>
31  #include "DataMaths.h"  #include "DataMaths.h"
32    
33  // #define CHECK_FOR_EX_WRITE if (!checkNoSharing()) {throw DataException("Attempt to modify shared object");}  // #define CHECK_FOR_EX_WRITE if (!checkNoSharing()) {throw DataException("Attempt to modify shared object");}
# Line 239  DataConstant::eigenvalues_and_eigenvecto Line 240  DataConstant::eigenvalues_and_eigenvecto
240    DataMaths::eigenvalues_and_eigenvectors(m_data, getShape(),0,temp_ev->getVectorRW(), temp_ev->getShape(),0,temp_V->getVectorRW(), temp_V->getShape(),0,tol);    DataMaths::eigenvalues_and_eigenvectors(m_data, getShape(),0,temp_ev->getVectorRW(), temp_ev->getShape(),0,temp_V->getVectorRW(), temp_V->getShape(),0,tol);
241  }  }
242    
243    
244    
245    void
246    DataConstant::matrixInverse(DataAbstract* out) const
247    {
248      DataConstant* temp=dynamic_cast<DataConstant*>(out);
249      if (temp==0)
250      {
251        throw DataException("Error - DataConstant::matrixInverse: casting to DataConstant failed (propably a programming error).");
252      }
253      if (getRank()!=2)
254      {
255        throw DataException("Error - DataExpanded::matrixInverse: input must be rank 2.");
256      }
257      LapackInverseHelper h(getShape()[0]);
258      int res=DataMaths::matrix_inverse(m_data, getShape(), 0, temp->getVectorRW(), temp->getShape(), 0, 1, h);
259      if (res)
260      {
261        DataMaths::matrixInverseError(res); // throws exceptions
262      }
263    }
264    
265  void  void
266  DataConstant::setToZero()  DataConstant::setToZero()
267  {  {

Legend:
Removed from v.2741  
changed lines
  Added in v.2742

  ViewVC Help
Powered by ViewVC 1.1.26