Sleipnir
src/bayesnetint.h
00001 /*****************************************************************************
00002 * This file is provided under the Creative Commons Attribution 3.0 license.
00003 *
00004 * You are free to share, copy, distribute, transmit, or adapt this work
00005 * PROVIDED THAT you attribute the work to the authors listed below.
00006 * For more information, please see the following web page:
00007 * http://creativecommons.org/licenses/by/3.0/
00008 *
00009 * This file is a component of the Sleipnir library for functional genomics,
00010 * authored by:
00011 * Curtis Huttenhower (chuttenh@princeton.edu)
00012 * Mark Schroeder
00013 * Maria D. Chikina
00014 * Olga G. Troyanskaya (ogt@princeton.edu, primary contact)
00015 *
00016 * If you use this library, the included executable tools, or any related
00017 * code in your work, please cite the following publication:
00018 * Curtis Huttenhower, Mark Schroeder, Maria D. Chikina, and
00019 * Olga G. Troyanskaya.
00020 * "The Sleipnir library for computational functional genomics"
00021 *****************************************************************************/
00022 #ifndef BAYESNETINT_H
00023 #define BAYESNETINT_H
00024 
00025 #include "fullmatrix.h"
00026 
00027 namespace Sleipnir {
00028 
00029 class CDat;
00030 class CPCL;
00031 class CPCLPair;
00032 class IDataset;
00033 
00045 class IBayesNet {
00046 public:
00062     virtual bool Open( const char* szFile ) = 0;
00077     virtual bool Save( const char* szFile ) const = 0;
00109     virtual bool Learn( const IDataset* pDataset, size_t iIterations, bool fZero = false,
00110         bool fELR = false ) = 0;
00143     virtual bool Evaluate( const IDataset* pDataset, std::vector<std::vector<float> >& vecvecdResults,
00144         bool fZero = false ) const = 0;
00173     virtual bool Evaluate( const IDataset* pDataset, CDat& DatResults, bool fZero = false ) const = 0;
00206     virtual bool Evaluate( const std::vector<unsigned char>& vecbDatum, std::vector<float>& vecdResults,
00207         bool fZero = false, size_t iNode = 0, bool fIgnoreMissing = false ) const = 0;
00247     virtual bool Evaluate( const CPCLPair& PCLData, CPCL& PCLResults, bool fZero = false,
00248         int iAlgorithm = -1 ) const = 0;
00256     virtual void GetNodes( std::vector<std::string>& vecstrNodes ) const = 0;
00270     virtual unsigned char GetValues( size_t iNode ) const = 0;
00278     virtual bool IsContinuous( ) const = 0;
00289     virtual bool IsContinuous( size_t iNode ) const = 0;
00298     virtual void Randomize( ) = 0;
00310     virtual void Randomize( size_t iNode ) = 0;
00326     virtual void Reverse( size_t iNode ) = 0;
00351     virtual bool GetCPT( size_t iNode, CDataMatrix& MatCPT ) const = 0;
00352 };
00353 
00354 }
00355 
00356 #endif // BAYESNETINT_H