Commit 36fdf237082b62434ea5e0d35fd4a0d42bb896b0

Authored by Jürgen Knödlseder
1 parent 3b6d4069

Use print method for printing.

Showing 1 changed file with 15 additions and 14 deletions
pyext/GMatrix.i
1 1 /***************************************************************************
2   - * GMatrix.i - Matrix class SWIG file *
  2 + * GMatrix.i - General Matrix class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2011 by Jurgen Knodlseder *
  4 + * copyright (C) 2008-2012 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -24,13 +24,15 @@
24 24 #include "GTools.hpp"
25 25 %}
26 26  
27   -%feature("notabstract") GMatrix;
  27 +//%feature("notabstract") GMatrix;
28 28  
29   -/***************************************************************************
30   - * GMatrix class definition *
31   - * ----------------------------------------------------------------------- *
32   - * GMatrix implements a full matrix storage class. It derives from the *
33   - * abstract base class GMatrixBase. *
  29 +/***********************************************************************//**
  30 + * @class GMatrix
  31 + *
  32 + * @brief General matrix class definition
  33 + *
  34 + * GMatrix implements a general matrix storage class. It derives from the
  35 + * abstract base class GMatrixBase.
34 36 ***************************************************************************/
35 37 class GMatrix : public GMatrixBase {
36 38 public:
... ... @@ -72,15 +74,14 @@ public:
72 74 };
73 75  
74 76  
75   -/***************************************************************************
76   - * GMatrix class SWIG extension *
  77 +/***********************************************************************//**
  78 + * @brief GMatrix class extension
  79 + *
  80 + * @todo Use typemap to allow for a [row,col] matrix access
77 81 ***************************************************************************/
78 82 %extend GMatrix {
79 83 char *__str__() {
80   - std::ostringstream buffer;
81   - buffer << *self;
82   - std::string str = buffer.str();
83   - return tochar(str);
  84 + return tochar(self->print());
84 85 }
85 86 double __getslice__(int row, int col) {
86 87 if (row >=0 && row < (int)self->rows() && col >= 0 && col < (int)self->cols())
... ...