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

datanode.cpp

Go to the documentation of this file.
00001 //****************************************************
00002 //  April, 1993, University of Illinois
00003 // Copyright (C) 1993, 1994 Tianlin Wang
00004 /* Copyright (C) 1994-2003 Matvec Development Team. 
00005 
00006   This program is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010   
00011   This program is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015     
00016   You should have received a copy of the GNU Library General Public
00017   License along with this library; if not, write to the Free
00018   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00019   MA 02111-1307, USA 
00020 */
00021 
00022 #include <iostream>
00023 #include <cstdlib>
00024 #include <cstring>
00025 #include <iomanip>
00026 
00027 #include "datanode.h"
00028 
00029 namespace matvec {
00030 
00031 DataNode::DataNode(const DataNode& A)
00032 {
00033    copyfrom(A);
00034 }
00035 
00036 void DataNode::copyfrom(const DataNode& A)
00037 {
00038    if (this == &A) return;
00039    data = A.data;
00040    missing = A.missing;
00041 }
00042 
00043 const DataNode& DataNode::operator=(const DataNode& A)
00044 {
00045    copyfrom(A);
00046    return *this;
00047 }
00048 
00049 std::ostream&  operator<<(std::ostream& stream, const DataNode& A)
00050 {
00051    std::cout.precision(6);
00052    if (A.missing) {
00053       stream << " " << std::setw(12) << ".";
00054    }
00055    else {
00056       stream << " " << std::setw(12) << A.data.double_value;
00057    }
00058    return stream;
00059 }
00060 }  //////////// end of namespace matvec

Generated on Thu Jun 16 17:13:38 2005 for Matvec by doxygen1.2.16