| 1 | //
 | 
|---|
| 2 | // matrix_i.h
 | 
|---|
| 3 | //
 | 
|---|
| 4 | // Copyright (C) 1996 Limit Point Systems, Inc.
 | 
|---|
| 5 | //
 | 
|---|
| 6 | // Author: Curtis Janssen <cljanss@limitpt.com>
 | 
|---|
| 7 | // Maintainer: LPS
 | 
|---|
| 8 | //
 | 
|---|
| 9 | // This file is part of the SC Toolkit.
 | 
|---|
| 10 | //
 | 
|---|
| 11 | // The SC Toolkit is free software; you can redistribute it and/or modify
 | 
|---|
| 12 | // it under the terms of the GNU Library General Public License as published by
 | 
|---|
| 13 | // the Free Software Foundation; either version 2, or (at your option)
 | 
|---|
| 14 | // any later version.
 | 
|---|
| 15 | //
 | 
|---|
| 16 | // The SC Toolkit is distributed in the hope that it will be useful,
 | 
|---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 19 | // GNU Library General Public License for more details.
 | 
|---|
| 20 | //
 | 
|---|
| 21 | // You should have received a copy of the GNU Library General Public License
 | 
|---|
| 22 | // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
 | 
|---|
| 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 | 
|---|
| 24 | //
 | 
|---|
| 25 | // The U.S. Government is granted a limited license as per AL 91-7.
 | 
|---|
| 26 | //
 | 
|---|
| 27 | 
 | 
|---|
| 28 | #ifndef _math_scmat_matrix_i_h
 | 
|---|
| 29 | #define _math_scmat_matrix_i_h
 | 
|---|
| 30 | #ifdef __GNUC__
 | 
|---|
| 31 | #pragma interface
 | 
|---|
| 32 | #endif
 | 
|---|
| 33 | 
 | 
|---|
| 34 | #include <math/scmat/matrix.h>
 | 
|---|
| 35 | 
 | 
|---|
| 36 | // These are the inline candidates for the members defined in matrix.h.
 | 
|---|
| 37 | 
 | 
|---|
| 38 | #ifdef INLINE_FUNCTIONS
 | 
|---|
| 39 | #define INLINE inline
 | 
|---|
| 40 | #else
 | 
|---|
| 41 | #define INLINE
 | 
|---|
| 42 | #endif
 | 
|---|
| 43 | 
 | 
|---|
| 44 | namespace sc {
 | 
|---|
| 45 | 
 | 
|---|
| 46 | // /////////////////////////////////////////////////////////////////////////
 | 
|---|
| 47 | // SCMatrixdouble inline candidates
 | 
|---|
| 48 | 
 | 
|---|
| 49 | INLINE
 | 
|---|
| 50 | SCMatrixdouble::SCMatrixdouble(SCMatrix*a,int b,int c):
 | 
|---|
| 51 |   matrix(a),i(b),j(c)
 | 
|---|
| 52 | {
 | 
|---|
| 53 | }
 | 
|---|
| 54 | INLINE
 | 
|---|
| 55 | SCMatrixdouble::~SCMatrixdouble()
 | 
|---|
| 56 | {
 | 
|---|
| 57 | }
 | 
|---|
| 58 | INLINE double
 | 
|---|
| 59 | SCMatrixdouble::operator=(double a)
 | 
|---|
| 60 | {
 | 
|---|
| 61 |   matrix.set_element(i,j,a);
 | 
|---|
| 62 |   return a;
 | 
|---|
| 63 | }
 | 
|---|
| 64 | INLINE double
 | 
|---|
| 65 | SCMatrixdouble::operator=(const SCMatrixdouble& md)
 | 
|---|
| 66 | {
 | 
|---|
| 67 |   double a = md.val();
 | 
|---|
| 68 |   matrix.set_element(i,j,a);
 | 
|---|
| 69 |   return a;
 | 
|---|
| 70 | }
 | 
|---|
| 71 | INLINE
 | 
|---|
| 72 | SCMatrixdouble::operator double()
 | 
|---|
| 73 | {
 | 
|---|
| 74 |   return matrix.get_element(i,j);
 | 
|---|
| 75 | }
 | 
|---|
| 76 | INLINE double
 | 
|---|
| 77 | SCMatrixdouble::val() const
 | 
|---|
| 78 | {
 | 
|---|
| 79 |   return matrix.get_element(i,j);
 | 
|---|
| 80 | }
 | 
|---|
| 81 | 
 | 
|---|
| 82 | // /////////////////////////////////////////////////////////////////////////
 | 
|---|
| 83 | // SymmSCMatrixdouble inline candidates
 | 
|---|
| 84 | 
 | 
|---|
| 85 | INLINE
 | 
|---|
| 86 | SymmSCMatrixdouble::SymmSCMatrixdouble(SymmSCMatrix*a,int b,int c):
 | 
|---|
| 87 |   matrix(a),i(b),j(c)
 | 
|---|
| 88 | {
 | 
|---|
| 89 | }
 | 
|---|
| 90 | INLINE
 | 
|---|
| 91 | SymmSCMatrixdouble::~SymmSCMatrixdouble()
 | 
|---|
| 92 | {
 | 
|---|
| 93 | }
 | 
|---|
| 94 | INLINE double
 | 
|---|
| 95 | SymmSCMatrixdouble::operator=(double a)
 | 
|---|
| 96 | {
 | 
|---|
| 97 |   matrix.set_element(i,j,a);
 | 
|---|
| 98 |   return a;
 | 
|---|
| 99 | }
 | 
|---|
| 100 | INLINE double
 | 
|---|
| 101 | SymmSCMatrixdouble::operator=(const SymmSCMatrixdouble& md)
 | 
|---|
| 102 | {
 | 
|---|
| 103 |   double a = md.val();
 | 
|---|
| 104 |   matrix.set_element(i,j,a);
 | 
|---|
| 105 |   return a;
 | 
|---|
| 106 | }
 | 
|---|
| 107 | INLINE
 | 
|---|
| 108 | SymmSCMatrixdouble::operator double()
 | 
|---|
| 109 | {
 | 
|---|
| 110 |   return matrix.get_element(i,j);
 | 
|---|
| 111 | }
 | 
|---|
| 112 | INLINE double
 | 
|---|
| 113 | SymmSCMatrixdouble::val() const
 | 
|---|
| 114 | {
 | 
|---|
| 115 |   return matrix.get_element(i,j);
 | 
|---|
| 116 | }
 | 
|---|
| 117 | 
 | 
|---|
| 118 | // /////////////////////////////////////////////////////////////////////////
 | 
|---|
| 119 | // DiagSCMatrixdouble inline candidates
 | 
|---|
| 120 | 
 | 
|---|
| 121 | INLINE
 | 
|---|
| 122 | DiagSCMatrixdouble::DiagSCMatrixdouble(DiagSCMatrix*a,int b,int c):
 | 
|---|
| 123 |   matrix(a),i(b),j(c)
 | 
|---|
| 124 | {
 | 
|---|
| 125 | }
 | 
|---|
| 126 | INLINE
 | 
|---|
| 127 | DiagSCMatrixdouble::~DiagSCMatrixdouble()
 | 
|---|
| 128 | {
 | 
|---|
| 129 | }
 | 
|---|
| 130 | INLINE double
 | 
|---|
| 131 | DiagSCMatrixdouble::operator=(double a)
 | 
|---|
| 132 | {
 | 
|---|
| 133 |   matrix.set_element(i,a);
 | 
|---|
| 134 |   return a;
 | 
|---|
| 135 | }
 | 
|---|
| 136 | INLINE double
 | 
|---|
| 137 | DiagSCMatrixdouble::operator=(const DiagSCMatrixdouble& md)
 | 
|---|
| 138 | {
 | 
|---|
| 139 |   double a = md.val();
 | 
|---|
| 140 |   matrix.set_element(i,a);
 | 
|---|
| 141 |   return a;
 | 
|---|
| 142 | }
 | 
|---|
| 143 | INLINE
 | 
|---|
| 144 | DiagSCMatrixdouble::operator double()
 | 
|---|
| 145 | {
 | 
|---|
| 146 |   return matrix.get_element(i);
 | 
|---|
| 147 | }
 | 
|---|
| 148 | INLINE double
 | 
|---|
| 149 | DiagSCMatrixdouble::val() const
 | 
|---|
| 150 | {
 | 
|---|
| 151 |   return matrix.get_element(i);
 | 
|---|
| 152 | }
 | 
|---|
| 153 | 
 | 
|---|
| 154 | // /////////////////////////////////////////////////////////////////////////
 | 
|---|
| 155 | // SCVectordouble inline candidates
 | 
|---|
| 156 | 
 | 
|---|
| 157 | INLINE
 | 
|---|
| 158 | SCVectordouble::SCVectordouble(SCVector*a,int b):
 | 
|---|
| 159 |   vector(a),i(b)
 | 
|---|
| 160 | {
 | 
|---|
| 161 | }
 | 
|---|
| 162 | INLINE
 | 
|---|
| 163 | SCVectordouble::~SCVectordouble()
 | 
|---|
| 164 | {
 | 
|---|
| 165 | }
 | 
|---|
| 166 | INLINE double
 | 
|---|
| 167 | SCVectordouble::operator=(double a)
 | 
|---|
| 168 | {
 | 
|---|
| 169 |   vector.set_element(i,a);
 | 
|---|
| 170 |   return a;
 | 
|---|
| 171 | }
 | 
|---|
| 172 | INLINE double
 | 
|---|
| 173 | SCVectordouble::operator=(const SCVectordouble& vd)
 | 
|---|
| 174 | {
 | 
|---|
| 175 |   double a = vd.val();
 | 
|---|
| 176 |   vector.set_element(i,a);
 | 
|---|
| 177 |   return a;
 | 
|---|
| 178 | }
 | 
|---|
| 179 | INLINE
 | 
|---|
| 180 | SCVectordouble::operator double()
 | 
|---|
| 181 | {
 | 
|---|
| 182 |   return vector.get_element(i);
 | 
|---|
| 183 | }
 | 
|---|
| 184 | INLINE double
 | 
|---|
| 185 | SCVectordouble::val() const
 | 
|---|
| 186 | {
 | 
|---|
| 187 |   return vector.get_element(i);
 | 
|---|
| 188 | }
 | 
|---|
| 189 | 
 | 
|---|
| 190 | }
 | 
|---|
| 191 | 
 | 
|---|
| 192 | #undef INLINE
 | 
|---|
| 193 | 
 | 
|---|
| 194 | #endif
 | 
|---|
| 195 | 
 | 
|---|
| 196 | // Local Variables:
 | 
|---|
| 197 | // mode: c++
 | 
|---|
| 198 | // c-file-style: "CLJ"
 | 
|---|
| 199 | // End:
 | 
|---|