The profits and losses of a limited partnership shall be allocated among the partners, and among classes of partners, in the manner provided in the partnership agreement. If the partnership agreement does not so provide, profits and losses shall be allocated on the basis of the value of the contributions of each partner.