SCM

SCM Repository

[matrix] Diff of /pkg/src/dsyMatrix.c
ViewVC logotype

Diff of /pkg/src/dsyMatrix.c

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

revision 889, Thu Sep 1 14:19:01 2005 UTC revision 890, Thu Sep 1 17:18:08 2005 UTC
# Line 1  Line 1 
1  #include "dsyMatrix.h"  #include "dsyMatrix.h"
2    
3  SEXP dsyMatrix_validate(SEXP obj)  SEXP symmetricMatrix_validate(SEXP obj)
4  {  {
5      SEXP val;      SEXP val = GET_SLOT(obj, Matrix_DimSym);
6      int *Dim = INTEGER(GET_SLOT(obj, Matrix_DimSym));      if (LENGTH(val) < 2)
7            return mkString(_("'Dim' slot has length less than two"));
8        if (INTEGER(val)[0] != INTEGER(val)[1])
9            return mkString(_("Matrix is not square"));
10      if (isString(val = check_scalar_string(GET_SLOT(obj, Matrix_uploSym),      if (isString(val = check_scalar_string(GET_SLOT(obj, Matrix_uploSym),
11                                             "LU", "uplo"))) return val;                                             "LU", "uplo"))) return val;
     if (Dim[0] != Dim[1])  
         return mkString(_("Symmetric matrix must be square"));  
12      return ScalarLogical(1);      return ScalarLogical(1);
13  }  }
14    
15    SEXP dsyMatrix_validate(SEXP obj)
16    {
17        return symmetricMatrix_validate(obj);
18        /* see ./dspMatrix.c  for how to do further checks */
19    }
20    
21  double get_norm_sy(SEXP obj, char *typstr)  double get_norm_sy(SEXP obj, char *typstr)
22  {  {
23      char typnm[] = {'\0', '\0'};      char typnm[] = {'\0', '\0'};

Legend:
Removed from v.889  
changed lines
  Added in v.890

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge