Source: constant.h


Annotated List
Files
Globals
Hierarchy
Index
/*  constant.h - 
    This file is part of Kalamaris
    Copyright (C) 2000  Antonio Larrosa Jimenez
    Kalamaris' homepage : http://www.arrakis.es/~rlarrosa/kalamaris.html

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 

    Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>

 ***************************************************************************/
#include "map.h"
#include "vartype.h"

class Constant : public Map
{
protected:
  friend class Matrix;
  friend class TMatrix;
  
  T *c;

  public:
  Constant(const QString &num, const QString &nam=QString());
  Constant(const T &g);
  Constant(const double g, const QString &nam=QString());
  Constant(T *_c);
  virtual ~Constant();

  virtual Map *copy(void);    

  virtual Map *eval (const QDict <Map> &vars);

  virtual Map *derive(const class Variable &var, const QDict <Map> &vars);

  virtual inline T *t(void) const { return c; };

  virtual QString string(void) const;
  virtual QString help(void) const;
  
  inline static Map *add(Constant * &m1, Constant * &m2); 
  inline static Map *sub(Constant * &m1, Constant * &m2); 
  inline static Map *mul(Constant * &m1, Constant * &m2); 
  inline static Map *div(Constant * &m1, Constant * &m2); 
  inline static Map *pow(Constant * &m1, Constant * &m2, 
	bool managem1=false, bool managem2=false);

  static Constant *newConstantG(const T &g);
};

/*
inline Constant *operator +(const Constant &c1, const Constant &c2);
inline Constant *operator -(const Constant &c1, const Constant &c2);
inline Constant *operator *(const Constant &c1, const Constant &c2);
inline Constant *operator /(const Constant &c1, const Constant &c2);
*/


Generated by: antlarr@terminus on Wed May 31 08:19:51 2000, using kdoc 2.0a22.