Changeset 62b35b6 in git for factory/cf_map.cc


Ignore:
Timestamp:
Sep 8, 1997, 1:08:40 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
f2e9720fc9b4b4de4841d283700d4dc41f0eb53b
Parents:
38eab603130b954c28838dc7d34d13ea7784b0ae
Message:
	* cf_map.cc: doc fix


git-svn-id: file:///usr/local/Singular/svn/trunk@668 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_map.cc

    r38eab60 r62b35b6  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_map.cc,v 1.8 1997-08-01 11:45:54 schmidt Exp $ */
     2/* $Id: cf_map.cc,v 1.9 1997-09-08 11:08:40 schmidt Exp $ */
    33
    44//{{{ docu
     
    2121#endif
    2222
     23//{{{ MapPair & MapPair::operator = ( const MapPair & p )
     24//{{{ docu
     25//
     26// MapPair::operator = - assignment operator.
     27//
     28//}}}
     29MapPair &
     30MapPair::operator = ( const MapPair & p )
     31{
     32    if ( this != &p ) {
     33        V = p.V;
     34        S = p.S;
     35    }
     36    return *this;
     37}
     38//}}}
     39
     40#ifndef NOSTREAMIO
     41//{{{ ostream & operator << ( ostream & s, const MapPair & p )
     42//{{{ docu
     43//
     44// operator << - print a map pair ("V -> S").
     45//
     46//}}}
     47ostream &
     48operator << ( ostream & s, const MapPair & p )
     49{
     50    s << p.var() << " -> " << p.subst();
     51    return s;
     52}
     53//}}}
     54#endif /* NOSTREAMIO */
     55
     56//{{{ CFMap::CFMap ( const CFList & L )
     57//{{{ docu
     58//
     59// CFMap::CFMap() - construct a CFMap from a CFList.
     60//
     61// Variable[i] will be mapped to CFList[i] under the resulting
     62// map.
     63//
     64//}}}
     65CFMap::CFMap ( const CFList & L )
     66{
     67    CFListIterator i;
     68    int j;
     69    for ( i = L, j = 1; i.hasItem(); i++, j++ )
     70        P.insert( MapPair( Variable(j), i.getItem() ) );
     71}
     72//}}}
     73
     74//{{{ CFMap & CFMap::operator = ( const CFMap & m )
     75//{{{ docu
     76//
     77// CFMap::operator = - assignment operator.
     78//
     79//}}}
     80CFMap &
     81CFMap::operator = ( const CFMap & m )
     82{
     83    if ( this != &m )
     84        P = m.P;
     85    return *this;
     86}
     87//}}}
     88
    2389//{{{ static int cmpfunc ( const MapPair & p1, const MapPair & p2 )
    2490//{{{ docu
     
    45111//
    46112// cmpfunc() and insfunc() are used as functions for inserting a
    47 // map pair into a Map.
     113// map pair into a map by CFMap::newpair().
    48114//
    49115//}}}
     
    55121//}}}
    56122
    57 //{{{ static CanonicalForm subsrec( const CanonicalForm & f, const MPListIterator & i )
     123//{{{ void CFMap::newpair ( const Variable & v, const CanonicalForm & s )
     124//{{{ docu
     125//
     126// CFMap::newpair() - insert a MapPair into a CFMap.
     127//
     128//}}}
     129void
     130CFMap::newpair ( const Variable & v, const CanonicalForm & s )
     131{
     132    P.insert( MapPair( v, s ), cmpfunc, insfunc );
     133}
     134//}}}
     135
     136//{{{ static CanonicalForm subsrec ( const CanonicalForm & f, const MPListIterator & i )
    58137//{{{ docu
    59138//
     
    63142// expression are not subject to further substitutions.
    64143//
     144// Used by: CFMap::operator ()().
     145//
    65146//}}}
    66147static CanonicalForm
    67 subsrec( const CanonicalForm & f, const MPListIterator & i )
     148subsrec ( const CanonicalForm & f, const MPListIterator & i )
    68149{
    69150    if ( f.inBaseDomain() ) return f;
     
    100181//}}}
    101182
    102 //{{{ MapPair& MapPair::operator = ( const MapPair & p )
    103 //{{{ docu
    104 //
    105 // MapPair::operator = - assignment operator.
    106 //
    107 //}}}
    108 MapPair&
    109 MapPair::operator = ( const MapPair & p )
    110 {
    111     if ( this != &p ) {
    112         V = p.V;
    113         S = p.S;
    114     }
    115     return *this;
    116 }
    117 //}}}
    118 
    119 #ifndef NOSTREAMIO
    120 //{{{ ostream& operator << ( ostream& s, const MapPair & p )
    121 //{{{ docu
    122 //
    123 // operator << - print a map pair ("V -> S").
    124 //
    125 //}}}
    126 ostream&
    127 operator << ( ostream& s, const MapPair & p )
    128 {
    129     s << p.var() << " -> " << p.subst();
    130     return s;
    131 }
    132 //}}}
    133 #endif /* NOSTREAMIO */
    134 
    135 //{{{ CFMap::CFMap ( const CFList & L )
    136 //{{{ docu
    137 //
    138 // CFMap::CFMap() - construct a CFMap from a CFList.
    139 //
    140 // Variable[i] will be mapped to CFList[i] under the resulting
    141 // map.
    142 //
    143 //}}}
    144 CFMap::CFMap ( const CFList & L )
    145 {
    146     CFListIterator i;
    147     int j;
    148     for ( i = L, j = 1; i.hasItem(); i++, j++ )
    149         P.insert( MapPair( Variable(j), i.getItem() ) );
    150 }
    151 //}}}
    152 
    153 //{{{ CFMap& CFMap::operator = ( const CFMap & m )
    154 //{{{ docu
    155 //
    156 // CFMap::operator = - assignment operator.
    157 //
    158 //}}}
    159 CFMap&
    160 CFMap::operator = ( const CFMap & m )
    161 {
    162     if ( this != &m )
    163         P = m.P;
    164     return *this;
    165 }
    166 //}}}
    167 
    168 //{{{ void CFMap::newpair( const Variable & v, const CanonicalForm & s )
    169 //{{{ docu
    170 //
    171 // CFMap::newpair() - inserts a MapPair into a CFMap.
    172 //
    173 //}}}
    174 void
    175 CFMap::newpair( const Variable & v, const CanonicalForm & s )
    176 {
    177     P.insert( MapPair( v, s ), cmpfunc, insfunc );
    178 }
    179 //}}}
    180 
    181183//{{{ CanonicalForm CFMap::operator () ( const CanonicalForm & f ) const
    182184//{{{ docu
    183185//
    184 // CFMap::operator () - apply the map to f.
     186// CFMap::operator () - apply CO to f.
    185187//
    186188// See subsrec() for more detailed information.
     
    196198
    197199#ifndef NOSTREAMIO
    198 //{{{ ostream& operator << ( ostream& s, const CFMap & m )
     200//{{{ ostream & operator << ( ostream & s, const CFMap & m )
    199201//{{{ docu
    200202//
     
    202204//
    203205//}}}
    204 ostream&
    205 operator << ( ostream& s, const CFMap & m )
     206ostream &
     207operator << ( ostream & s, const CFMap & m )
    206208{
    207209    return s << m.P;
Note: See TracChangeset for help on using the changeset viewer.