Navigation Menu

Skip to content

Commit

Permalink
+ some binary operations
Browse files Browse the repository at this point in the history
  • Loading branch information
canercandan committed Feb 14, 2011
1 parent 83cc2ae commit f4967c8
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/petsc_cxx/AdditionMatrix.h
@@ -0,0 +1,39 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Caner Candan <caner@candan.fr>, http://caner.candan.fr
*/

#ifndef _petsc_cxx_AdditionMatrix_h
#define _petsc_cxx_AdditionMatrix_h

#include "BO.h"
#include "Matrix.h"

namespace petsc_cxx
{
template < typename Atom >
class AdditionMatrix : public BO< Matrix< Atom >, Matrix< Atom >, Matrix< Atom > >
{
public:
void operator()( const Matrix< Atom >& A, const Matrix< Atom >& B, Matrix< Atom >& C )
{
// TODO
}
};
}

#endif // !_petsc_cxx_AdditionMatrix_h
31 changes: 31 additions & 0 deletions src/petsc_cxx/BO.h
@@ -0,0 +1,31 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Caner Candan <caner@candan.fr>, http://caner.candan.fr
*/

#ifndef _petsc_cxx_BO_h
#define _petsc_cxx_BO_h

#include "TF.h"

namespace petsc_cxx
{
template < typename A1, typename A2, typename R >
class BO : public TF< const A1&, const A2&, R&, void > {};
}

#endif // !_petsc_cxx_BO_h
39 changes: 39 additions & 0 deletions src/petsc_cxx/Dot.h
@@ -0,0 +1,39 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Caner Candan <caner@candan.fr>, http://caner.candan.fr
*/

#ifndef _petsc_cxx_Dot_h
#define _petsc_cxx_Dot_h

#include "BO.h"
#include "Vector.h"

namespace petsc_cxx
{
template < typename Atom >
class Dot : public BO< Vector< Atom >, Vector< Atom >, Atom >
{
public:
void operator()( const Vector< Atom >& a, const Vector< Atom >& b, Atom& dot )
{
// TODO
}
};
}

#endif // !_petsc_cxx_Dot_h
40 changes: 40 additions & 0 deletions src/petsc_cxx/MultiplyMatVec.h
@@ -0,0 +1,40 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Caner Candan <caner@candan.fr>, http://caner.candan.fr
*/

#ifndef _petsc_cxx_MultiplyMatVec_h
#define _petsc_cxx_MultiplyMatVec_h

#include "BO.h"
#include "Vector.h"
#include "Matrix.h"

namespace petsc_cxx
{
template < typename Atom >
class MultiplyMatVec : public BO< Matrix< Atom >, Vector< Atom >, Vector< Atom > >
{
public:
void operator()( const Matrix< Atom >& A, const Vector< Atom >& x, Vector< Atom >& b )
{
// TODO
}
};
}

#endif // !_petsc_cxx_MultiplyMatVec_h

0 comments on commit f4967c8

Please sign in to comment.