java - Using set() in ArrayList doesn't get it updated -


मेरे पास एक क्लास MathMatrix से यह सदस्य कार्य है, जो ArrayList और lt; अर्रेलिस्ट & lt; डबल>>।

  सार्वजनिक शून्य LUFactPivoting (MathMatrix l, MathMatrix u) LUException फेंकता है, CloneNotSupportedException {double [] Parray = {1,2,3,4}; पी = नया मथविक्टर (पैरा); MathMatrix temp = नया मैथमैट्रिक्स (यह); Int n = ncols; डबल बहु; के लिए (int k = 0; k & lt; n; k ++) {System.out.println ("ताम:" + u.toString ()); यह। द्वितीयक प्रश्नोत्तर चरण (एल, अस्थायी, कश्मीर); के लिए (int i = k + 1; i & lt; n; i ++) {if (temp.getElem (कश्मीर) == 0) System.out.println ("ZERO"); Mult = temp.getElem (i, k) / temp.getElem (k, k); एल.से.एलेम (आई, कश्मीर, बहु); के लिए (इंट जे = कश्मीर; जे एंड एलटी; एन; जे ++) {डबल न्यूवल = टेम्पी.गेट एलेम (आई, जे) - मल्टी * टेम्पी.एस्टएलेम (कश्मीर, जे); Temp.setElem (i, जे, न्यूवल); }}} के लिए (int i = 0; i & lt; n; i ++) {l.setElem (i, i, 1.0); } के लिए (int i = 0; i & lt; n; i ++) {for (int j = i; j & lt; n; j ++) {u.setElem (i, जे, temp.getElem (i, j)); }}}  

मैं ArrayList.set () का उपयोग कर रहा / रही हूं, लेकिन जब मैं this.partialPivotingStep (l, temp) को कॉल करता हूं तो ऑब्जेक्ट अपडेट नहीं होता है , कश्मीर) , इसलिए ऑब्जेक्ट अस्थायी एक ही रूप में आरक्षित रहता है जब मैं इसे एक तर्क के रूप में पास करता हूं (लेकिन जब मैं इसे LUFactPivoting में उपयोग करता हूं) समस्या क्या है?


Comments

Popular posts from this blog

javascript - How to use the code plugin with popcornjs -

python - rpy2 import is not working -

Python, converting png to gif using ImageMagick -