comparison liboctave/fRowVector.cc @ 10314:07ebe522dac2

untabify liboctave C++ sources
author John W. Eaton <jwe@octave.org>
date Thu, 11 Feb 2010 12:23:32 -0500
parents 4c0cdbe0acca
children a0728e81ed25
comparison
equal deleted inserted replaced
10313:f3b65e1ae355 10314:07ebe522dac2
40 40
41 extern "C" 41 extern "C"
42 { 42 {
43 F77_RET_T 43 F77_RET_T
44 F77_FUNC (sgemv, SGEMV) (F77_CONST_CHAR_ARG_DECL, 44 F77_FUNC (sgemv, SGEMV) (F77_CONST_CHAR_ARG_DECL,
45 const octave_idx_type&, const octave_idx_type&, const float&, 45 const octave_idx_type&, const octave_idx_type&, const float&,
46 const float*, const octave_idx_type&, const float*, 46 const float*, const octave_idx_type&, const float*,
47 const octave_idx_type&, const float&, float*, const octave_idx_type& 47 const octave_idx_type&, const float&, float*, const octave_idx_type&
48 F77_CHAR_ARG_LEN_DECL); 48 F77_CHAR_ARG_LEN_DECL);
49 F77_RET_T 49 F77_RET_T
50 F77_FUNC (xsdot, XSDOT) (const octave_idx_type&, const float*, const octave_idx_type&, 50 F77_FUNC (xsdot, XSDOT) (const octave_idx_type&, const float*, const octave_idx_type&,
51 const float*, const octave_idx_type&, float&); 51 const float*, const octave_idx_type&, float&);
52 } 52 }
53 53
54 // Row Vector class. 54 // Row Vector class.
55 55
56 bool 56 bool
82 if (a_len > 0) 82 if (a_len > 0)
83 { 83 {
84 make_unique (); 84 make_unique ();
85 85
86 for (octave_idx_type i = 0; i < a_len; i++) 86 for (octave_idx_type i = 0; i < a_len; i++)
87 xelem (c+i) = a.elem (i); 87 xelem (c+i) = a.elem (i);
88 } 88 }
89 89
90 return *this; 90 return *this;
91 } 91 }
92 92
98 if (len > 0) 98 if (len > 0)
99 { 99 {
100 make_unique (); 100 make_unique ();
101 101
102 for (octave_idx_type i = 0; i < len; i++) 102 for (octave_idx_type i = 0; i < len; i++)
103 xelem (i) = val; 103 xelem (i) = val;
104 } 104 }
105 105
106 return *this; 106 return *this;
107 } 107 }
108 108
122 if (c2 >= c1) 122 if (c2 >= c1)
123 { 123 {
124 make_unique (); 124 make_unique ();
125 125
126 for (octave_idx_type i = c1; i <= c2; i++) 126 for (octave_idx_type i = c1; i <= c2; i++)
127 xelem (i) = val; 127 xelem (i) = val;
128 } 128 }
129 129
130 return *this; 130 return *this;
131 } 131 }
132 132
208 if (a_nr != len) 208 if (a_nr != len)
209 gripe_nonconformant ("operator *", 1, len, a_nr, a_nc); 209 gripe_nonconformant ("operator *", 1, len, a_nr, a_nc);
210 else 210 else
211 { 211 {
212 if (len == 0) 212 if (len == 0)
213 retval.resize (a_nc, 0.0); 213 retval.resize (a_nc, 0.0);
214 else 214 else
215 { 215 {
216 // Transpose A to form A'*x == (x'*A)' 216 // Transpose A to form A'*x == (x'*A)'
217 217
218 octave_idx_type ld = a_nr; 218 octave_idx_type ld = a_nr;
219 219
220 retval.resize (a_nc); 220 retval.resize (a_nc);
221 float *y = retval.fortran_vec (); 221 float *y = retval.fortran_vec ();
222 222
223 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 ("T", 1), 223 F77_XFCN (sgemv, SGEMV, (F77_CONST_CHAR_ARG2 ("T", 1),
224 a_nr, a_nc, 1.0, a.data (), 224 a_nr, a_nc, 1.0, a.data (),
225 ld, v.data (), 1, 0.0, y, 1 225 ld, v.data (), 1, 0.0, y, 1
226 F77_CHAR_ARG_LEN (1))); 226 F77_CHAR_ARG_LEN (1)));
227 } 227 }
228 } 228 }
229 229
230 return retval; 230 return retval;
231 } 231 }
232 232