Lines Matching refs:nodes
28 public $nodes;
40 $this->nodes = $exp;
41 $this->nodes = $this->parse();
49 if (count($this->nodes) <= 3) {
50 return $this->nodes;
54 for ($i = 0; $i < count($this->nodes); $i++) {
55 if ($this->nodes[$i]->text == '(' || $this->nodes[$i]->text == '{') {
57 } elseif ($this->nodes[$i]->text == ')' || $this->nodes[$i]->text == '}') {
60 $sub = array_slice($this->nodes, $pos + 1, $i - $pos - 1);
61 if ($this->nodes[$i]->text == ')') {
72 $ret[] = $this->nodes[$i];
107 * @param array $nodes
111 public function handleOperation(array $nodes, $operation)
115 if (count($nodes) <= 3) {
116 return $nodes;
119 for ($i = 0; $i < count($nodes); $i++) {
120 if (!$change && $i < count($nodes) - 2 && $nodes[$i + 1]->text == $operation) {
121 $ret[] = new MathExpression(array($nodes[$i], $nodes[$i + 1], $nodes[$i + 2]), $this->helper);
125 $ret[] = $nodes[$i];
128 $nodes = $ret;
135 * @param array $nodes
140 public function handleFunction(array $nodes, $function, $argumentsCount)
142 if (count($nodes) <= $argumentsCount + 1) {
143 return $nodes;
146 for ($i = 0; $i < count($nodes); $i++) {
147 if ($i < count($nodes) - $argumentsCount && $nodes[$i]->text == $function) {
150 $a[] = $nodes[$j];
155 $ret[] = $nodes[$i];
168 switch (count($this->nodes)) {
170 $this->nodes[0]->draw($size);
171 $this->image = $this->nodes[0]->image;
172 $this->verticalBased = $this->nodes[0]->verticalBased;
175 switch ($this->nodes[0]->text) {
197 if ($this->nodes[0]->text == "lim") {
199 } elseif ($this->nodes[0]->text == "root") {
202 switch ($this->nodes[1]->text) {
225 switch ($this->nodes[0]->text) {
281 for ($i = 0; $i < count($this->nodes); $i++) {
282 if ($this->nodes[$i]->text != '(' && $this->nodes[$i]->text != ')') {
283 $this->nodes[$i]->draw($size);
284 $img[$i] = $this->nodes[$i]->image;
285 $base[$i] = $this->nodes[$i]->verticalBased;
293 for ($i = 0; $i < count($this->nodes); $i++) {
295 if ($this->nodes[$i]->text == "(") {
326 $this->nodes[0]->draw($size * 0.9);
327 $img1 = $this->nodes[0]->image;
328 $this->nodes[2]->draw($size * 0.9);
329 $img2 = $this->nodes[2]->image;
352 $this->nodes[0]->draw($size);
353 $img1 = $this->nodes[0]->image;
354 $base1 = $this->nodes[0]->verticalBased;
355 $this->nodes[2]->draw($size * 0.8);
356 $img2 = $this->nodes[2]->image;
387 $this->nodes[0]->draw($size);
388 $img1 = $this->nodes[0]->image;
389 $base1 = $this->nodes[0]->verticalBased;
390 $this->nodes[2]->draw($size * 0.8);
391 $img2 = $this->nodes[2]->image;
422 $this->nodes[1]->draw($size);
423 $imgExp = $this->nodes[1]->image;
424 $baseExp = $this->nodes[1]->verticalBased;
451 $this->nodes[1]->draw($size * 0.6);
452 $imgRoot = $this->nodes[1]->image;
456 $this->nodes[2]->draw($size);
457 $imgExp = $this->nodes[2]->image;
458 $baseExp = $this->nodes[2]->verticalBased;
487 $this->nodes[1]->draw($size * 0.8);
488 $img1 = $this->nodes[1]->image;
489 $this->nodes[2]->draw($size * 0.8);
490 $img2 = $this->nodes[2]->image;
491 $this->nodes[3]->draw($size);
492 $imgExp = $this->nodes[3]->image;
493 $baseExp = $this->nodes[3]->verticalBased;
524 $this->nodes[2]->draw($size * 0.8);
525 $imgSup = $this->nodes[2]->image;
526 $this->nodes[0]->draw($size);
527 $imgExp = $this->nodes[0]->image;
528 $baseExp = $this->nodes[0]->verticalBased;
552 $this->nodes[2]->draw($size * 0.8);
553 $imgInf = $this->nodes[2]->image;
554 $this->nodes[0]->draw($size);
555 $imgExp = $this->nodes[0]->image;
556 $baseExp = $this->nodes[0]->verticalBased;
581 $nbLine = $this->nodes[1]->nodes[0]->text;
582 $nbColumn = $this->nodes[2]->nodes[0]->text;
602 if ($i < count($this->nodes[3]->nodes)) {
603 $this->nodes[3]->nodes[$i]->draw($size * 0.9);
604 $img[$i] = $this->nodes[3]->nodes[$i]->image;
605 $base[$i] = $this->nodes[3]->nodes[$i]->verticalBased;
634 if ($i < count($this->nodes[3]->nodes)) {
663 $typeLine = $this->nodes[1]->nodes[0]->text;
664 $typeColumn = $this->nodes[2]->nodes[0]->text;
686 if ($i < count($this->nodes[3]->nodes)) {
687 $this->nodes[3]->nodes[$i]->draw($size * 0.9);
688 $img[$i] = $this->nodes[3]->nodes[$i]->image;
689 $base[$i] = $this->nodes[3]->nodes[$i]->verticalBased;
723 if ($i < count($this->nodes[3]->nodes)) {
770 $this->nodes[1]->draw($size);
771 $imgExp = $this->nodes[1]->image;
772 $baseExp = $this->nodes[1]->verticalBased;
800 $this->nodes[1]->draw($size);
801 $imgExp = $this->nodes[1]->image;
802 $baseExp = $this->nodes[1]->verticalBased;
825 $this->nodes[1]->draw($size);
826 $imgExp = $this->nodes[1]->image;
827 $baseExp = $this->nodes[1]->verticalBased;
851 $this->nodes[1]->draw($size);
852 $imgExp = $this->nodes[1]->image;
853 $baseExp = $this->nodes[1]->verticalBased;
882 $this->nodes[1]->draw($size * 0.8);
883 $imgInf = $this->nodes[1]->image;
887 $this->nodes[2]->draw($size);
888 $imgExp = $this->nodes[2]->image;
889 $baseExp = $this->nodes[2]->verticalBased;
908 $this->nodes[2]->draw($size);
909 $imgExp = $this->nodes[2]->image;
910 $baseExp = $this->nodes[2]->verticalBased;
912 if ($this->nodes[1]->text == "&$") {
913 $leftImg = $this->helper->parenthesis($heightExp, $this->nodes[1]->nodes[0]->text);
915 $leftImg = $this->helper->parenthesis($heightExp, $this->nodes[1]->text);
918 if ($this->nodes[3]->text == "&$") {
919 if(isset($this->nodes[3]->nodes[0])) {
920 $rightImg = $this->helper->parenthesis($heightExp, $this->nodes[3]->nodes[0]->text);
925 $rightImg = $this->helper->parenthesis($heightExp, $this->nodes[3]->text);