Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

UnconditionalDistribution.cc

Go to the documentation of this file.
00001 // -*- C++ -*- 00002 00003 // UnconditionalDistribution.cc 00004 // 00005 // Copyright (C) 2004 Olivier Delalleau 00006 // 00007 // Redistribution and use in source and binary forms, with or without 00008 // modification, are permitted provided that the following conditions are met: 00009 // 00010 // 1. Redistributions of source code must retain the above copyright 00011 // notice, this list of conditions and the following disclaimer. 00012 // 00013 // 2. Redistributions in binary form must reproduce the above copyright 00014 // notice, this list of conditions and the following disclaimer in the 00015 // documentation and/or other materials provided with the distribution. 00016 // 00017 // 3. The name of the authors may not be used to endorse or promote 00018 // products derived from this software without specific prior written 00019 // permission. 00020 // 00021 // THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 00022 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00023 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00024 // NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00025 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 00026 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00027 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00028 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00029 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 // 00032 // This file is part of the PLearn library. For more information on the PLearn 00033 // library, go to the PLearn Web site at www.plearn.org 00034 00035 /* ******************************************************* 00036 * $Id: UnconditionalDistribution.cc,v 1.2 2004/07/21 19:11:59 chrish42 Exp $ 00037 ******************************************************* */ 00038 00039 // Authors: Olivier Delalleau 00040 00044 #include "UnconditionalDistribution.h" 00045 00046 namespace PLearn { 00047 using namespace std; 00048 00050 // UnconditionalDistribution // 00052 UnconditionalDistribution::UnconditionalDistribution() 00053 /* ### Initialize all fields to their default value here */ 00054 { 00055 // ... 00056 00057 // ### You may or may not want to call build_() to finish building the object 00058 // build_(); 00059 } 00060 00061 PLEARN_IMPLEMENT_OBJECT(UnconditionalDistribution, 00062 "This class is a simplified version of PDistribution for unconditional distributions.", 00063 "Its only goal is to hide the conditional side of PDistributions to make it simpler." 00064 ); 00065 00067 // declareOptions // 00069 void UnconditionalDistribution::declareOptions(OptionList& ol) 00070 { 00071 // ### Declare all of this object's options here 00072 // ### For the "flags" of each option, you should typically specify 00073 // ### one of OptionBase::buildoption, OptionBase::learntoption or 00074 // ### OptionBase::tuningoption. Another possible flag to be combined with 00075 // ### is OptionBase::nosave 00076 00077 // ### ex: 00078 // declareOption(ol, "myoption", &UnconditionalDistribution::myoption, OptionBase::buildoption, 00079 // "Help text describing this option"); 00080 // ... 00081 00082 // First call the parent class' declareOptions(). 00083 inherited::declareOptions(ol); 00084 00085 // And modify some options for unconditional distributions. 00086 00087 redeclareOption(ol, "outputs_def", &PDistribution::outputs_def, OptionBase::buildoption, 00088 "Defines what will be given in output. This is a string where the characters\n" 00089 "have the following meaning:\n" 00090 "'l'-> log_density, 'd' -> density, 'c' -> cdf, 's' -> survival_fn,\n" 00091 "'e' -> expectation, 'v' -> variance.\n" 00092 "In lower case they give the value associated with a given observation.\n" 00093 "In upper case, a curve is evaluated at regular intervals and produced in\n" 00094 "output (as a histogram), only for 'L', 'D', 'C' and 'S'.\n" 00095 "The number of curve points is determined by the 'n_curve_points' option.\n" 00096 "Note that the upper case letters only work for SCALAR variables." 00097 ); 00098 00099 redeclareOption(ol, "conditional_flags", &UnconditionalDistribution::conditional_flags, OptionBase::nosave, 00100 "Unused in unconditional distributions."); 00101 00102 redeclareOption(ol, "provide_input", &UnconditionalDistribution::provide_input, OptionBase::nosave, 00103 "Unused in unconditional distributions."); 00104 00105 redeclareOption(ol, "cond_sort", &UnconditionalDistribution::cond_sort, OptionBase::nosave, 00106 "Unused in unconditional distributions."); 00107 00108 redeclareOption(ol, "n_input", &UnconditionalDistribution::n_input, OptionBase::nosave, 00109 "Unused in unconditional distributions."); 00110 00111 redeclareOption(ol, "n_target", &UnconditionalDistribution::n_target, OptionBase::nosave, 00112 "Unused in unconditional distributions."); 00113 00114 redeclareOption(ol, "n_margin", &UnconditionalDistribution::n_margin, OptionBase::nosave, 00115 "Unused in unconditional distributions."); 00116 00117 } 00118 00120 // build // 00122 void UnconditionalDistribution::build() 00123 { 00124 inherited::build(); 00125 build_(); 00126 } 00127 00129 // build_ // 00131 void UnconditionalDistribution::build_() 00132 { 00133 } 00134 00136 // makeDeepCopyFromShallowCopy // 00138 void UnconditionalDistribution::makeDeepCopyFromShallowCopy(map<const void*, void*>& copies) 00139 { 00140 inherited::makeDeepCopyFromShallowCopy(copies); 00141 } 00142 00144 // setInput // 00146 void UnconditionalDistribution::setInput(const Vec& input) const { 00147 PLERROR("setInput not implemented for UnconditionalDistribution"); 00148 } 00149 00151 // updateFromConditionalSorting // 00153 void UnconditionalDistribution::updateFromConditionalSorting() { 00154 PLERROR("updateFromConditionalSorting not implemented for UnconditionalDistribution"); 00155 } 00156 00157 } // end of namespace PLearn 00158

Generated on Tue Aug 17 16:09:32 2004 for PLearn by doxygen 1.3.7