MCPcopy Create free account
hub / github.com/Singular/Singular / spmulProc

Function spmulProc

Singular/ipshell.cc:4465–4496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4463// ----------------------------------------------------------------------------
4464
4465BOOLEAN spmulProc( leftv result,leftv first,leftv second )
4466{
4467 semicState state;
4468
4469 // -----------------
4470 // check arguments
4471 // -----------------
4472
4473 lists l = (lists)first->Data( );
4474 int k = (int)(long)second->Data( );
4475
4476 if( (state=list_is_spectrum( l ))!=semicOK )
4477 {
4478 WerrorS( "first argument is not a spectrum" );
4479 list_error( state );
4480 }
4481 else if( k < 0 )
4482 {
4483 WerrorS( "second argument should be positive" );
4484 state = semicMulNegative;
4485 }
4486 else
4487 {
4488 spectrum s= spectrumFromList( l );
4489 spectrum product( k*s );
4490
4491 result->rtyp = LIST_CMD;
4492 result->data = (char*)getList(product);
4493 }
4494
4495 return (state!=semicOK);
4496}
4497
4498// ----------------------------------------------------------------------------
4499// this procedure is called from the interpreter

Callers 1

jjSYSTEMFunction · 0.85

Calls 6

list_is_spectrumFunction · 0.85
WerrorSFunction · 0.85
list_errorFunction · 0.85
spectrumFromListFunction · 0.85
getListFunction · 0.70
DataMethod · 0.45

Tested by

no test coverage detected