Class: CAMatrix

Inherits:
CAWrap
  • Object
show all
Defined in:
ext/carray_gsl.c,
lib/carray-gsl/core.rb

Instance Method Summary collapse

Instance Method Details

#*(other) ⇒ Object



658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
# File 'lib/carray-gsl/core.rb', line 658

def * (other)
  case other
  when CAVector
    CArray.attach(self, other) {
      return (self.gm * other.gv).ca.v      
    }
  when CAMatrix
    CArray.attach(self, other) {
      return (self.gm * other.gm).ca.m      
    }
  when CArray
    CArray.attach(self, other) {
      return (self[] * other).m
    }
  else
    attach {
      return (self.gm * other).ca.m      
    }
  end
end

#diagonalObject



691
692
693
694
695
# File 'lib/carray-gsl/core.rb', line 691

def diagonal
  attach {
    return self.gm.diagonal.ca.v
  }
end

#lowerObject



679
680
681
682
683
# File 'lib/carray-gsl/core.rb', line 679

def lower
  attach {
    return self.gm.lower.ca.m
  }
end

#upperObject



685
686
687
688
689
# File 'lib/carray-gsl/core.rb', line 685

def upper
  attach {
    return self.gm.upper.ca.m
  }
end