Results 1 to 3 of 3

Thread: Input result into file

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    7

    Question Input result into file

    Code:
    #include "stdafx.h"
    #include <imsl.h>
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	int m1 = 3;
    	int n1 = 3;
    	double a1[] = {1, -1, 1,
    	               3, 2, 4,
    	               3, 2, 0};
    	double b1[] = {20, 42, 30};
    	double c1[] = {-5, -4, -6};
    	double lb1[] = {0, 0, 0};
    	int ctype1[] = {1, 1, 1};
    	double *x1, obj1;
    
    	x1 = imsl_d_linear_programming(m1, n1, a1, b1, c1, 
    		IMSL_CONSTR_TYPE, ctype1, 
    		IMSL_LOWER_BOUND, lb1, 
    		IMSL_OBJ, &obj1, 
    		0);
    	imsl_d_write_matrix("x", 1, n1, x1, 0);
    	printf("Optimal value: %f\n", obj1);
    
    	return 0;
    }
    I need to input result into file.

    Can you help me modify this code?

    PS maybe imsls_f_write_matrix function must be used

  2. #2
    See the function imsl_output_file() in Chapter 12 of the C/Math documentation.
    hth,
    -w

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    7
    omega, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •