Changeset 49c9e43 in git for kernel/Poly.h


Ignore:
Timestamp:
Aug 16, 2005, 3:40:57 PM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
ef1452cd49d0a519c81e3ffe1bdf3b719b6d72eb
Parents:
5acfea3cd67353ca02441a08fb6b399646b631fc
Message:
*bricken: some more ops


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

Legend:

Unmodified
Added
Removed
  • kernel/Poly.h

    r5acfea3 r49c9e43  
    1 //$Id: Poly.h,v 1.5 2005-08-16 12:20:23 bricken Exp $
     1//$Id: Poly.h,v 1.6 2005-08-16 13:40:57 bricken Exp $
    22
    33
     
    169169    this->r=r;
    170170  }
     171  PolyImpl(const Number & n){
     172   
     173    r=n.r;
     174    this->p=p_NSet(n_Copy(n.n,r),r);
     175   
     176  }
    171177  explicit PolyImpl(int n){
    172178    r=currRing;
     
    347353    omfree(cp);
    348354  }
     355  Poly(const Poly&p):ptr(p.ptr){
     356  }
     357  Poly(const Number& n):ptr(new PolyImpl(n)){
     358   
     359  }
    349360  Poly(std::vector<int> v, ring r=currRing):ptr(new PolyImpl((poly) NULL,r)){
    350361    unsigned int i;
     
    388399    ptr=p.ptr;
    389400    }*/
    390   Poly(const Poly&p):ptr(p.ptr){
    391   }
     401
    392402  PolyInputIterator<Poly> begin(){
    393403    return PolyInputIterator<Poly>(ptr->p,ptr->r);
     
    410420  friend inline Poly operator+(const Poly& p1, const Poly& p2);
    411421  friend inline Poly operator*(const Poly& p1, const Poly& p2);
     422  friend inline Poly operator*(const Poly& p1, const Number& n);
     423  // friend inline Poly operator*(const Poly& p1, const Number& n);
    412424 
    413425};
     
    423435    return(Poly(*res));
    424436}
    425 
     437inline Poly operator*(const Poly& p1, const Number& n){
     438    PolyImpl* res=new PolyImpl(*p1.ptr);
     439    *res *= n;
     440    return(Poly(*res));
     441}
    426442
    427443
Note: See TracChangeset for help on using the changeset viewer.