SCM

SCM Repository

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

Diff of /pkg/src/dtrMatrix.c

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

revision 846, Wed Aug 10 22:08:35 2005 UTC revision 890, Thu Sep 1 17:18:08 2005 UTC
# Line 2  Line 2 
2    
3  #include "dtrMatrix.h"  #include "dtrMatrix.h"
4    
5  /* FIXME: Validation works "funny": dtrMatrix_as_dgeMatrix()  {below}  SEXP triangularMatrix_validate(SEXP obj)
  * -----  is called *before* the following - presumably in order to  
  *        apply the higher level validation first  
 */  
 SEXP dtrMatrix_validate(SEXP obj)  
6  {  {
7      SEXP val;      SEXP val = GET_SLOT(obj, Matrix_DimSym);
     int *Dims = INTEGER(GET_SLOT(obj, Matrix_DimSym));  
8    
9      if (Dims[0] != Dims[1])      if (LENGTH(val) < 2)
10            return mkString(_("'Dim' slot has length less than two"));
11        if (INTEGER(val)[0] != INTEGER(val)[1])
12          return mkString(_("Matrix is not square"));          return mkString(_("Matrix is not square"));
13      if (isString(val = check_scalar_string(GET_SLOT(obj, Matrix_uploSym),      if (isString(val = check_scalar_string(GET_SLOT(obj, Matrix_uploSym),
14                                             "LU", "uplo"))) return val;                                             "LU", "uplo"))) return val;
# Line 20  Line 17 
17      return ScalarLogical(1);      return ScalarLogical(1);
18  }  }
19    
20    /* FIXME: validObject(.) works "funny": dtrMatrix_as_dgeMatrix()  {below}
21     * -----  is called *before* the following - presumably in order to
22     *        apply the higher level validation first.
23    */
24    SEXP dtrMatrix_validate(SEXP obj)
25    {
26        return triangularMatrix_validate(obj);
27    }
28    
29    
30  static  static
31  double get_norm(SEXP obj, char *typstr)  double get_norm(SEXP obj, char *typstr)
32  {  {

Legend:
Removed from v.846  
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