intdsyev.c File Reference

#include "stack-c.h"

Include dependency graph for intdsyev.c:

Go to the source code of this file.

Defines

#define MAX(x, y)   (((x)>(y))?(x):(y))
#define MIN(x, y)   (((x)<(y))?(x):(y))

Functions

int intdsyev (char *fname)


Define Documentation

#define MAX ( x,
y   )     (((x)>(y))?(x):(y))

Definition at line 5 of file intdsyev.c.

#define MIN ( x,
y   )     (((x)<(y))?(x):(y))

Definition at line 6 of file intdsyev.c.


Function Documentation

int intdsyev ( char*  fname  ) 

Definition at line 8 of file intdsyev.c.

References A, C2F, CheckLhs, CheckRhs, CreateVar, Error, errorinfo(), GetRhsVar, L, Lhs, LhsVar, lw, M, MAX, maxvol(), N, sciprint(), stk, and WORK.

Referenced by C2F().

00010 { 
00011   int M,N,lA;
00012   int NLHS;
00013   int mU, nU, lU, U;
00014   int un=1; int WORK, lWORK, LWORKMIN, LWORK, INFO;
00015   int LDA, lw;
00016   int A=1, W=2;
00017 
00018   static int minlhs=1, minrhs=1, maxlhs=2, maxrhs=1;
00019   CheckRhs(minrhs,maxrhs) ;  CheckLhs(minlhs,maxlhs) ;
00020 
00021   /*--------------------A---------------------------*/
00022   GetRhsVar(A, "d", &M, &N, &lA);
00023   /*  To be done: Check A symmetric and Real*/
00024   NLHS=Lhs;
00025   switch ( NLHS ) {
00026   case 2:        
00027     /*  [w,U]=dsyev(A)     */
00028     CreateVar(W, "d", &N, &un, &lw);
00029     WORK=3;
00030     LWORKMIN = MAX(1, 3*N-1);
00031     LWORK = LWORKMIN;
00032     /* LWORK=C2F(maxvol)(&WORK, "d", 1L);   max memory currently available */
00033     if (LWORK < LWORKMIN) { 
00034       sciprint("not enough memory (use stacksize)");
00035       Error(9999); };
00036     CreateVar(3, "d", &LWORK, &un, &lWORK);
00037     LDA = MAX(1,N);
00038     C2F(dsyev)("V", "L", &N, stk(lA), &LDA, stk(lw), stk(lWORK), &LWORK, &INFO);
00039     if (INFO != 0) C2F(errorinfo)("dsyev ", &INFO, 5L);
00040     LhsVar(1)=A; LhsVar(2)=W;
00041     return 0;
00042     break;
00043   case 1:
00044     /*   w=dsyev(A)    */
00045     CreateVar(W, "d", &N, &un, &lw);
00046     WORK=3;
00047     LWORKMIN = MAX(1, 3*N-1);
00048     LWORK=C2F(maxvol)(&WORK, "d", 1L);  /* max memory currently available */
00049     if (LWORK < LWORKMIN) { 
00050       sciprint("not enough memory (use stacksize)");
00051       Error(9999); };
00052     CreateVar(3, "d", &LWORK, &un, &lWORK);
00053     LDA = MAX(1,N);
00054     C2F(dsyev)("N", "L", &N, stk(lA), &LDA, stk(lw), stk(lWORK), &LWORK, &INFO);
00055     if (INFO != 0) C2F(errorinfo)("dsyev ", &INFO, 5L);
00056     LhsVar(1)=W;
00057     return 0;
00058     break;
00059   default:
00060     return 0;
00061   }
00062   return(0);
00063 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 16:09:45 2007 for Scilab [trunk] by  doxygen 1.5.1