comparison src/pt-mat.cc @ 5514:e0011660696c

[project @ 2005-10-27 15:43:29 by jwe]
author jwe
date Thu, 27 Oct 2005 15:43:29 +0000
parents dae5ba706ff2
children 667ad2becb63
comparison
equal deleted inserted replaced
5513:843fa0a80229 5514:e0011660696c
65 tm_row_const_rep : public octave_base_list<octave_value> 65 tm_row_const_rep : public octave_base_list<octave_value>
66 { 66 {
67 public: 67 public:
68 68
69 tm_row_const_rep (void) 69 tm_row_const_rep (void)
70 : count (1), dv (), all_str (false), 70 : count (1), dv (0, 0), all_str (false),
71 all_sq_str (false), all_dq_str (false), 71 all_sq_str (false), all_dq_str (false),
72 some_str (false), all_real (false), all_cmplx (false), 72 some_str (false), all_real (false), all_cmplx (false),
73 all_mt (true), ok (false) { } 73 all_mt (true), ok (false) { }
74 74
75 tm_row_const_rep (const tree_argument_list& row) 75 tm_row_const_rep (const tree_argument_list& row)
76 : count (1), dv (), all_str (false), all_sq_str (false), 76 : count (1), dv (0, 0), all_str (false), all_sq_str (false),
77 some_str (false), all_real (false), all_cmplx (false), 77 some_str (false), all_real (false), all_cmplx (false),
78 all_mt (true), ok (false) 78 all_mt (true), ok (false)
79 { init (row); } 79 { init (row); }
80 80
81 ~tm_row_const_rep (void) { } 81 ~tm_row_const_rep (void) { }
148 { 148 {
149 if (rep && --rep->count == 0) 149 if (rep && --rep->count == 0)
150 delete rep; 150 delete rep;
151 } 151 }
152 152
153 octave_idx_type rows (void) 153 octave_idx_type rows (void) { return rep->dv(0); }
154 { return (rep->dv.length () > 0 ? rep->dv(0) : 0); } 154 octave_idx_type cols (void) { return rep->dv(1); }
155
156 octave_idx_type cols (void)
157 { return (rep->dv.length () > 1 ? rep->dv(1) : 0); }
158 155
159 dim_vector dims (void) { return rep->dv; } 156 dim_vector dims (void) { return rep->dv; }
160 157
161 bool all_strings_p (void) const { return rep->all_str; } 158 bool all_strings_p (void) const { return rep->all_str; }
162 bool all_sq_strings_p (void) const { return rep->all_sq_str; } 159 bool all_sq_strings_p (void) const { return rep->all_sq_str; }
355 tm_const : public octave_base_list<tm_row_const> 352 tm_const : public octave_base_list<tm_row_const>
356 { 353 {
357 public: 354 public:
358 355
359 tm_const (const tree_matrix& tm) 356 tm_const (const tree_matrix& tm)
360 : dv (), all_str (false), all_sq_str (false), all_dq_str (false), 357 : dv (0, 0), all_str (false), all_sq_str (false), all_dq_str (false),
361 some_str (false), all_real (false), all_cmplx (false), 358 some_str (false), all_real (false), all_cmplx (false),
362 all_mt (true), ok (false) 359 all_mt (true), ok (false)
363 { init (tm); } 360 { init (tm); }
364 361
365 ~tm_const (void) { } 362 ~tm_const (void) { }
366 363
367 octave_idx_type rows (void) const { return (dv.length () > 0 ? dv.elem (0) : 0); } 364 octave_idx_type rows (void) const { return dv.elem (0); }
368 octave_idx_type cols (void) const { return (dv.length () > 1 ? dv.elem (1) : 0); } 365 octave_idx_type cols (void) const { return dv.elem (1); }
369 366
370 dim_vector dims (void) const { return dv; } 367 dim_vector dims (void) const { return dv; }
371 368
372 bool all_strings_p (void) const { return all_str; } 369 bool all_strings_p (void) const { return all_str; }
373 bool all_sq_strings_p (void) const { return all_sq_str; } 370 bool all_sq_strings_p (void) const { return all_sq_str; }