PHP - Singular Value Decomposition (svd) In Php
I need Singular Value Decomposition (SVD) function in PHP.
Its a mathematical algorithm includes matrices processing. I have Python version but need it in PHP. Can anyone provide this in PHP? Thanks. Similar TutorialsSo I've been writing code trying to apply the separation principles -- MVC, and aside from MVC SRP (Single Responsibility Principle), and so on.
I now end up with classes that do this kind of type of function (one class per line)
* connector class that redirect to the real Controller
* read GET state, validate GET and direct to proper Action,
* class that preps SQL, runs SQL and cleans any data it receives
* class that sends data to be combined, receives results, and forwards the results to View
* class that combines data and produces results
* view is by itself in a template file ..
I am looking at this class soup and thinking ... oh my ... I go 4 classes deep just to get some data here. Am I overdoing it?
In the past I would have had a single file for controller and a single file for view. No classes. Maybe some helper functions from function library loaded by require()
Alternatively, I could tweak OOP that I will have a single Controller class that does everything and forwards things to View. But now my Controller only tries to route things and do business function, and business function is in another "business" class, and if business class needs data, it calls model class, and if model or business class need a helper function, they call the "helper function" class. So through all the class calling I am doing passing of vars to keep the execution thread going... What are your thoughts on the SRP/separation movement? I think it creates a lot of classes and it makes things a tad complicated. Looking at Zend Framework library code I have experienced the same type of "what the heck is this class for" and trying to chase execution thread through 10 or so classes when it is just a simple "submit a form, process data, return results" type event. I want things to be simpler. A discussion on style != a coding help question. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=356946.0 |