예제 #1
0
파일: input.c 프로젝트: fransklaver/SPOOLES
/*
   ---------------------------------
   input a complex row in the matrix

   created -- 98jan28, cca
   ---------------------------------
*/
void
InpMtx_inputComplexRow (
   InpMtx   *inpmtx,
   int       row,
   int       rowsize,
   int       rowind[],
   double    rowent[]
) {
/*
   --------------
   check the data
   --------------
*/
if (  inpmtx == NULL || row < 0 || rowsize < 0 
   || rowind == NULL || rowent == NULL ) {
   fprintf(stderr, 
           "\n fatal error in InpMtx_inputComplexRow(%p,%d,%d,%p,%p)"
           "\n bad input\n", inpmtx, row, rowsize, rowind, rowent) ;
   spoolesFatal();
}
if ( ! INPMTX_IS_COMPLEX_ENTRIES(inpmtx) ) {
   fprintf(stderr, 
           "\n fatal error in InpMtx_inputComplexRow(%p,%d,%d,%p,%p)"
           "\n inputMode is not SPOOLES_COMPLEX\n",
           inpmtx, row, rowsize, rowind, rowent) ;
   spoolesFatal();
}
inputRow(inpmtx, row, rowsize, rowind, rowent) ;

return ; }
예제 #2
0
파일: Modules.cpp 프로젝트: ctcchan/ctools
void Modules::populateRow(bool fixed, int rType, string prompt) {
    char answer;
    bool valid; //input valid check

    do {
        valid = true;
        cout << endl << "Would you like to use a randomly-generated twelve-tone row? (y/n): ";
        cin >> answer;
        if (!cin)
            inputInvalid(valid);
        else {
            switch (answer) {
                case 'y':
                    setRowSize(12, rType);
                    generateTwelve(rType);
                    break;
                case 'n':
                    cout << endl << prompt << endl;
                    if(fixed == false)	// if the array size is not fixed, prompt user to input size
                        inputRowLength(rType);
                    inputRow(rType);
                    break;
                default:
                    inputInvalid(valid);
            }
        }
    } while (valid == false);
}
예제 #3
0
파일: input.c 프로젝트: fransklaver/SPOOLES
/*
   ------------------------------
   input a real row in the matrix

   created -- 98jan28, cca
   ------------------------------
*/
void
InpMtx_inputRow (
   InpMtx   *inpmtx,
   int       row,
   int       rowsize,
   int       rowind[]
) {
/*
   --------------
   check the data
   --------------
*/
if (  inpmtx == NULL || row < 0 || rowsize < 0 || rowind == NULL ) {
   fprintf(stderr, 
           "\n fatal error in InpMtx_inputRow(%p,%d,%d,%p)"
           "\n bad input\n", inpmtx, row, rowsize, rowind) ;
   spoolesFatal();
}
if ( ! INPMTX_IS_INDICES_ONLY(inpmtx) ) {
   fprintf(stderr, 
           "\n fatal error in InpMtx_inputRow(%p,%d,%d,%p)"
           "\n inputMode is not INPMTX_INDICES_ONLY\n",
           inpmtx, row, rowsize, rowind) ;
   spoolesFatal();
}
inputRow(inpmtx, row, rowsize, rowind, NULL) ;

return ; }