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

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

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

revision 576 by gross, Fri Mar 3 08:28:42 2006 UTC revision 580 by gross, Wed Mar 8 05:45:51 2006 UTC
# Line 728  DataArrayView::shapeToString(const DataA Line 728  DataArrayView::shapeToString(const DataA
728      return temp.str();      return temp.str();
729  }  }
730    
 void  
 DataArrayView::eigenvalues(const DataArrayView& in,  
                            DataArrayView& ev)  
 {  
    EsysAssert(!in.isEmpty(),  
                "Error - in view is empty.");  
    EsysAssert(!ev.isEmpty(),  
                "Error - ev view is empty.");  
    EsysAssert(in.getRank()==2,  
                "Error - in has not rank 2.");  
    EsysAssert(in.getShape()[0]==in.getShape()[1],  
                "Error - in is not square");  
    EsysAssert(ev.getRank()==1,  
                "Error - ev has not rank 1.");  
    EsysAssert(ev.getShape()[0]==in.getShape()[0],  
                "Error - ev is too short");  
    EsysAssert(0<ev.getShape()[0] && ev.getShape()[0]<4,  
                "Error - dimension is restricted to 3.");  
    double ev0,ev1,ev2;  
    int s=in.getShape()[0];  
    if (s==1) {  
       eigenvalues1(in(0,0),&ev0);  
       ev(0)=ev0;  
   
    } else  if (s==2) {  
       eigenvalues2(in(0,0),(in(0,1)+in(1,0))/2.,in(1,1),  
                    &ev0,&ev1);  
       ev(0)=ev0;  
       ev(1)=ev1;  
   
    } else  if (s==3) {  
       eigenvalues3(in(0,0),(in(0,1)+in(1,0))/2.,(in(0,2)+in(2,0))/2.,in(1,1),(in(2,1)+in(1,2))/2.,in(2,2),  
                  &ev0,&ev1,&ev2);  
       ev(0)=ev0;  
       ev(1)=ev1;  
       ev(2)=ev2;  
   
    }  
 }  
   
731  void  void
732  DataArrayView::matMult(const DataArrayView& left,  DataArrayView::matMult(const DataArrayView& left,
733                         const DataArrayView& right,                         const DataArrayView& right,

Legend:
Removed from v.576  
changed lines
  Added in v.580

  ViewVC Help
Powered by ViewVC 1.1.26