Changeset 7161aca in git for Singular/LIB/standard.lib
- Timestamp:
- Aug 12, 2019, 11:10:44 AM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 8307d2d92aa305b1a9b4e0c9353dfc467f913461
- Parents:
- d4cec6ab781a81162945ff680935242fcccc952ab258e2adb78434353acc85388a6c40c626c4b5ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
rd4cec6a r7161aca 2517 2517 static proc parse_L1(string l1) 2518 2518 { 2519 if (find(l1, "(", 1) == 0) // no parentheses 2520 { 2521 return(int(l1)); 2522 } 2523 list tokens = tuple_to_tokens(l1); 2519 list tokens; 2520 if (l1[1] != "(") 2521 { 2522 tokens[1] = l1; 2523 } 2524 else 2525 { 2526 tokens = tuple_to_tokens(l1); 2527 } 2528 if (tokens[1] == "real") 2529 { 2530 int p1 = 6; 2531 int p2 = 6; 2532 if (size(tokens) > 1) 2533 { 2534 p1 = int(tokens[2]); 2535 p2 = p1; 2536 } 2537 if (size(tokens) > 2) 2538 { 2539 p2 = int(tokens[3]); 2540 } 2541 return(list(0, list(p1, p2))); 2542 } 2543 if (tokens[1] == "complex") 2544 { 2545 int p1 = 6; 2546 int p2 = 6; 2547 string imag_unit = "i"; 2548 if (int(tokens[size(tokens)]) == 0) // not an integer 2549 { 2550 imag_unit = tokens[size(tokens)]; 2551 tokens = delete(tokens, size(tokens)); 2552 } 2553 if (size(tokens) > 1) 2554 { 2555 p1 = int(tokens[2]); 2556 p2 = p1; 2557 } 2558 if (size(tokens) > 2) 2559 { 2560 p2 = int(tokens[3]); 2561 } 2562 return(list(0, list(p1, p2), imag_unit)); 2563 } 2524 2564 if (size(tokens) == 1) 2525 2565 { 2526 2566 return(int(tokens[1])); 2527 2567 } 2528 2568 list L = int(tokens[1]); … … 2537 2577 if (v[1, 4] == "var(" && defined(basering)) 2538 2578 { 2539 2540 2579 int i = int(v[5,size(v)-5]); 2580 v = ringlist(basering)[2][i]; 2541 2581 } 2542 2582 return(v); … … 2550 2590 static proc parse_L2(string l2) 2551 2591 { 2552 if ( find(l2, "(", 1) == 0) // no parentheses2553 { 2554 2592 if (l2[1] != "(") 2593 { 2594 return(list(parse_var(l2))); 2555 2595 } 2556 2596 list V = tuple_to_tokens(l2); 2557 2597 for (int i = size(V); i > 0; i--) 2558 2598 { 2559 2599 V[i] = parse_var(V[i]); 2560 2600 } 2561 2601 return(V); … … 2572 2612 { 2573 2613 string name; 2574 intvec w;2575 2614 int b1 = find(ordering, "(", 1); 2576 2615 if (b1 == 0) // no parentheses … … 2579 2618 if (name == "C" || name == "c") 2580 2619 { 2581 w = intvec(0);2620 intvec w = intvec(0); 2582 2621 } 2583 2622 else 2584 2623 { 2585 w = 1:n_vars;2624 intvec w = 1:n_vars; 2586 2625 } 2587 2626 } … … 2593 2632 if (c == 0) 2594 2633 { 2595 w = 1:int(ordering[b1+1, b2-b1-1]); 2634 if (name == "L") 2635 { 2636 int w = int(ordering[b1+1, b2-b1-1]); 2637 } 2638 if (name == "wp" || name == "Wp" || name == "ws" || name == "Ws" 2639 || name == "a") 2640 { 2641 intvec w = int(ordering[b1+1, b2-b1-1]); 2642 } 2643 if (!defined(w)) // else 2644 { 2645 intvec w = 1:int(ordering[b1+1, b2-b1-1]); 2646 } 2596 2647 } 2597 2648 else 2598 2649 { 2599 2650 list W = tuple_to_tokens(ordering[b1, b2-b1+1]); 2600 w = intvec(int(W[1..size(W)]));2651 intvec w = intvec(int(W[1..size(W)])); 2601 2652 } 2602 2653 }
Note: See TracChangeset
for help on using the changeset viewer.