Class: Tensorflow::Double

Inherits:
Object
  • Object
show all
Defined in:
ext/Tensorflow_wrap.cxx

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Object


15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
# File 'ext/Tensorflow_wrap.cxx', line 15723

SWIGINTERN VALUE
_wrap_new_Double(int argc, VALUE *argv, VALUE self) {
  size_t arg1 ;
  size_t val1 ;
  int ecode1 = 0 ;
  Double *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "size_t","Double", 1, argv[0] ));
  } 
  arg1 = static_cast< size_t >(val1);
  result = (Double *)new_Double(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}

Class Method Details

.frompointer(*args) ⇒ Object


15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
# File 'ext/Tensorflow_wrap.cxx', line 15866

SWIGINTERN VALUE
_wrap_Double_frompointer(int argc, VALUE *argv, VALUE self) {
  double *arg1 = (double *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Double *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "double *","Double_frompointer", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< double * >(argp1);
  result = (Double *)Double_frompointer(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Double, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

Instance Method Details

#[](*args) ⇒ Object

call-seq:

[](index) -> double

Element accessor/slicing.


15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
# File 'ext/Tensorflow_wrap.cxx', line 15764

SWIGINTERN VALUE
_wrap_Double___getitem__(int argc, VALUE *argv, VALUE self) {
  Double *arg1 = (Double *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Double *","__getitem__", 1, self )); 
  }
  arg1 = reinterpret_cast< Double * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__getitem__", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (double)Double___getitem__(arg1,arg2);
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}

#[]=(*args) ⇒ Object

call-seq:

[]=(index, value)

Element setter/slicing.


15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
# File 'ext/Tensorflow_wrap.cxx', line 15805

SWIGINTERN VALUE
_wrap_Double___setitem__(int argc, VALUE *argv, VALUE self) {
  Double *arg1 = (Double *) 0 ;
  size_t arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Double *","__setitem__", 1, self )); 
  }
  arg1 = reinterpret_cast< Double * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__setitem__", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","__setitem__", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  Double___setitem__(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}

#cast(*args) ⇒ Object


15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
# File 'ext/Tensorflow_wrap.cxx', line 15842

SWIGINTERN VALUE
_wrap_Double_cast(int argc, VALUE *argv, VALUE self) {
  Double *arg1 = (Double *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Double *","cast", 1, self )); 
  }
  arg1 = reinterpret_cast< Double * >(argp1);
  result = (double *)Double_cast(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}