Class: OOL::Conmin::Constraint
- Inherits:
-
GSL::Object
- Object
- GSL::Object
- OOL::Conmin::Constraint
- Defined in:
- ext/gsl_native/ool.c
Class Method Summary collapse
Instance Method Summary collapse
- #set(*args) ⇒ Object
- #set_L(vL) ⇒ Object (also: #L=)
- #set_LU(vL, vU) ⇒ Object (also: #LU=)
- #set_n(n) ⇒ Object (also: #n=)
- #set_U(vU) ⇒ Object (also: #U=)
Methods inherited from GSL::Object
Class Method Details
.alloc(*args) ⇒ Object
691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'ext/gsl_native/ool.c', line 691
static VALUE rb_ool_conmin_constraint_alloc(int argc, VALUE *argv, VALUE klass)
{
ool_conmin_constraint *C;
VALUE obj;
C = ALLOC(ool_conmin_constraint);
C->n = 0;
C->L = NULL;
C->U = NULL;
obj = Data_Wrap_Struct(klass, 0, free, C);
rb_ool_conmin_constraint_set(argc, argv, obj);
return obj;
}
|
Instance Method Details
#set(*args) ⇒ Object
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 |
# File 'ext/gsl_native/ool.c', line 744
static VALUE rb_ool_conmin_constraint_set(int argc, VALUE *argv, VALUE obj)
{
ool_conmin_constraint *C;
Data_Get_Struct(obj, ool_conmin_constraint, C);
switch (argc) {
case 0:
break;
case 1:
rb_ool_conmin_constraint_set_n(obj, argv[0]);
break;
case 2:
rb_ool_conmin_constraint_set_LU(obj, argv[0], argv[1]);
break;
case 3:
rb_ool_conmin_constraint_set_n(obj, argv[0]);
rb_ool_conmin_constraint_set_LU(obj, argv[1], argv[2]);
break;
default:
rb_raise(rb_eArgError, "Wrong number of arguments (%d for 1-3)", argc);
}
return obj;
}
|
#set_L(vL) ⇒ Object Also known as: L=
715 716 717 718 719 720 721 722 723 724 |
# File 'ext/gsl_native/ool.c', line 715
static VALUE rb_ool_conmin_constraint_set_L(VALUE obj, VALUE vL)
{
ool_conmin_constraint *C;
gsl_vector *L;
CHECK_VECTOR(vL);
Data_Get_Struct(obj, ool_conmin_constraint, C);
Data_Get_Struct(vL, gsl_vector, L);
C->L = L;
return vL;
}
|
#set_LU(vL, vU) ⇒ Object Also known as: LU=
737 738 739 740 741 742 |
# File 'ext/gsl_native/ool.c', line 737
static VALUE rb_ool_conmin_constraint_set_LU(VALUE obj, VALUE vL, VALUE vU)
{
rb_ool_conmin_constraint_set_L(obj, vL);
rb_ool_conmin_constraint_set_U(obj, vU);
return obj;
}
|
#set_n(n) ⇒ Object Also known as: n=
705 706 707 708 709 710 711 712 713 |
# File 'ext/gsl_native/ool.c', line 705
static VALUE rb_ool_conmin_constraint_set_n(VALUE obj, VALUE n)
{
ool_conmin_constraint *C;
if (!FIXNUM_P(n)) rb_raise(rb_eArgError, "Wrong argument type %s (Fixnum expected)",
rb_class2name(CLASS_OF(n)));
Data_Get_Struct(obj, ool_conmin_constraint, C);
C->n = (size_t) FIX2INT(n);
return n;
}
|
#set_U(vU) ⇒ Object Also known as: U=
726 727 728 729 730 731 732 733 734 735 |
# File 'ext/gsl_native/ool.c', line 726
static VALUE rb_ool_conmin_constraint_set_U(VALUE obj, VALUE vU)
{
ool_conmin_constraint *C;
gsl_vector *U;
CHECK_VECTOR(vU);
Data_Get_Struct(obj, ool_conmin_constraint, C);
Data_Get_Struct(vU, gsl_vector, U);
C->U = U;
return vU;
}
|